package com.systemCapacity.controller;


import com.systemCapacity.common.lang.Result;
import com.systemCapacity.entity.Enum.TenCapacityType;
import com.systemCapacity.service.ActivityResourceService;
import com.systemCapacity.service.BattleCapacityService;
import com.systemCapacity.service.SystemCapacityEvaluateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("capacity/evaluate")
public class SystemCapacityEvaluateController {

    @Autowired
    SystemCapacityEvaluateService systemCapacityEvaluateService;

    /**
     * 获取作战能力评估
     * @param capacityType 能力类型
     * @return 评估结果
     */
    @GetMapping
    public Result getEvaluateResult(@RequestParam(value = "capacityType") int capacityType) {
        if (capacityType < 0 || capacityType > TenCapacityType.values().length) {
            return Result.fail("所选十大能力不存在");
        }
        return Result.succ(systemCapacityEvaluateService.getEvaluate(capacityType));
    }
}
